//
//  Layer_Dock.m
//  Return Of The Lemi
//
//  Created by Paul Vishayanuroj on 11/16/09.
//  Copyright 2009 Paul Vishayanuroj. All rights reserved.
//

#import "Layer_Dock.h"


@implementation Layer_Dock

- (id) init
{
	if ((self = [super init]))
	{
		pos = CGPointMake(100, 100);
		items = [[NSMutableArray alloc] arrayWithCapacity:10];
		isTouchEnabled = YES;
	}
	return self;
}

// When the player first puts their finger down on the screen
- (BOOL) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 
{
	// Check if the player touched within the same relative horizontal plane as the character
	// If so, check the direction and walk in that direction
	UITouch *touch = [touches anyObject];
	CGPoint point = [touch locationInView: [touch view]];
	point = [[Director sharedDirector] convertToGL:point];
	
	return YES;
}

// When the player moves their finger across the screen
- (BOOL) ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 
{
	UITouch *touch = [touches anyObject];
	CGPoint point = [touch locationInView: [touch view]];
	point = [[Director sharedDirector] convertToGL:point];
	
	
	return YES;
}

// When the player lifts their finger off the screen
- (BOOL) ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 
{
	UITouch *touch = [touches anyObject];
	CGPoint point = [touch locationInView: [touch view]];
	point = [[Director sharedDirector] convertToGL:point];
	
	return YES;
}

@end

@implementation Dock_Button

/*
- (void) MoveRight
{
}

- (void) MoveLeft
{
}
*/
@end
